using System.Web;
using System.Web.UI;
using System.Web.Hosting;
using System.Collections.Generic;

namespace SBPweb.RIA.Server.Common.Web
{
    ///// <summary>
    ///// Summary description for ThemeManager
    ///// </summary>
    //public class ThemeManager
    //{
    //    /// <summary>
    //    /// List of available themes
    //    /// </summary>
    //    /// <returns>list</returns>
    //    public static List<string> ListAvailableThemes()
    //    {
    //        List<string> ret = new List<string>();
    //        foreach (VirtualDirectory d in ConfigurationHandler.GetRelativeVirtualDirectory("App_Themes").Directories)
    //        {
    //            ret.Add(d.Name);
    //        }

    //        return ret;
    //    }

    //    private const string KEY_SelectedThemeName = "_PreferredThemeName";

    //    /// <summary>
    //    /// currently selected theme
    //    /// </summary>
    //    public static string SelectedTheme
    //    {
    //        get
    //        {
    //            if (!SessionManager.Session.IsAvailable)
    //            {
    //                return CookieHandler.DefaultTheme;
    //            }
    //            string ret = SessionManager.Session.Get<string>(KEY_SelectedThemeName);
    //            if (string.IsNullOrEmpty(ret))
    //            {
    //                ret = CookieHandler.DefaultTheme;
    //                SessionManager.Session.Put<string>(KEY_SelectedThemeName, ret);
    //            }
    //            return ret;
    //        }
    //        set
    //        {
    //            if (!SessionManager.Session.IsAvailable)
    //            {
    //                return;
    //            }
    //            SessionManager.Session.Put<string>(KEY_SelectedThemeName, value);
    //            CookieHandler.DefaultTheme = value;
    //        }
    //    }

    //    /// <summary>
    //    /// Maintain the current theme
    //    /// </summary>
    //    /// <param name="page">page</param>
    //    public static void MaintainTheme(Page page)
    //    {
    //        if (page.Theme != ThemeManager.SelectedTheme)
    //        {
    //            //string s = ConfigurationHandler.VirtualRootDirectory.VirtualPath;

    //            //page.MasterPageFile = s + "xHTML/Masters/" + ThemeManager.SelectedTheme.Replace("xHTML.", "") + ".master";
    //            page.Theme = ThemeManager.SelectedTheme;
    //        }
    //    }
    //}
}